import React, { Component } from 'react'
import Search from './components/Search'
import List from './components/List'
import "./App.css";

export default class App extends Component {
	state = {
		list: [],
		isFirst: true, // 是否为第一次打开
		isLoading: false, // 是否处于加载中
		err: '', // 存储请求相关的错误信息
	}

	updateAppState = (stateObj) => {
		this.setState(stateObj)
	}

	render() {
		return (
			<div className="box">
				<Search updateAppState={this.updateAppState} />
				<List {...this.state} />
			</div>
		)
	}
}
